@extends('layouts.back_stage')
@section('content')
    <link rel="stylesheet" href="{{env('CDN_DOMAIN_NAME')}}/css/dateSelect.css"/>
    <script src="{{env('CDN_DOMAIN_NAME')}}/js/dateSelect.js"></script>
    <style>
        /*库存盘点*/
        .take_p{width:100%;text-align: center;}
        .take_lab{width:220px;line-height:30px;margin-right:10px;margin-bottom: 15px;}
        .take_lab1{width:240px;line-height:30px;margin-right:10px;margin-bottom: 15px;}
        .take_sel{width:160px;height: 30px;line-height:30px;float:right;outline:none;font-size: 13px;padding:5px 10px;font-weight: normal;border-radius: 2px;color: #555;background:#fff;background-image: none;border: 1px solid #cfdadd;box-shadow: none;}
        .btn_del{text-align: center;display:inline-block;margin-right:10px;}
        .take-choose{width:100%;line-height:10px;height:10px;margin:20px auto;}
        .take_div{color:#383838; width:100%;height:auto;}
        .take{border-collapse:collapse;width:100%;font-size:14px;color:#383838;background:#fff;margin-bottom:10px;}
        .take td{text-align:center;height:35px;}
        table,th,td{border:1px solid #ccc;}
    </style>
    <div class="container">
        <div style="padding:20px 0;"><h3>库存盘点</h3></div>
        <ul class="articles-ul">
            {{--库存盘点--}}
            <li class="articles-li">
                <form action="/storage/getClothAllStorage" method="get" >
                    {{ csrf_field() }}
                    <p class="take_p">
                        <label class="take_lab" >品牌：
                            <select class="take_sel sel" name="brand">
                                <option value="">请选择</option>
                                @foreach($brands as $k =>$v)
                                    <option value="{{$k}}"
                                    @if($where->brand==$k)
                                        selected
                                            @endif
                                    >{{$v}}</option>
                                @endforeach
                            </select>
                        </label>
                        <label class="take_lab">款号：
                            <input class="address sel" style="width: 160px" type="text" name="girard" placeholder="输入款号" value="{{$where->girard}}">
                        </label>

                        <label class="take_lab take_lab1">时间：
                            <input class="address sel" id="date1" style="width: 160px" type="text" readonly name="investment_at" placeholder="输入时间" value="{{$where->investment_at}}">
                        </label>
                        <button type="submit" class="btn btn_del btn-info">搜索</button>
                        <a class="btn bt_del btn-info" href="javascript:;" onclick="emptyTake()">清空</a>
                    </p>
                </form>
                <div class="take-choose">
                    <span>共<span class="mate_count">{{$count}}</span>条信息</span>
                </div>
                <div class="take_div">
                    <table class="take" border="1" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>品牌</td>
                            <td>款号</td>
                            <td>品类</td>
                            <td>入库量</td>
                            <td>入库时间</td>
                            <td>操作</td>
                        </tr>
                        @foreach($list as $k =>$v)
                        <tr>
                            <td>{{ $brands[$v->brand_id] or ''}}</td>
                            <td>{{ $v->girard }}</td>
                            <td>{{ $cate[$v->cate_id] }}</td>
                            <td>{{$v->storage_volume}}</td>
                            <td>{{$v->investment_at}}</td>
                            <td><a href="/storage/clothAllStorageDetail?id={{$v->id}}">详情</a></td>
                        </tr>
                        @endforeach
                    </table>
                </div>
            </li>
            <span style="float:right;">
                <div class="return_box" style="float: right;margin:20px 0;">
                    <button class="btn btn-info" onclick="returnPage()" style="float:right;">跳转</button>
                    <input type="text" class="form-control returnPage" style="width:6rem;float: right;margin:0 5px;">
                </div>
                {{$list->appends(['girard'=>$where->girard,'brand'=>$where->brand,'investment_at'=>$where->investment_at])->links()}}
            </span>
        </ul>
    </div>
    <script>
        /*日期插件初始化*/
        $("#date1").dateSelect();
        /*清空按钮*/
        function emptyTake(){
            $(".sel").each(function(){
                $(this).val("");
            })
        }
        $(document).ready(function () {
            if($('.mate_count').text() < 10){
                $('.return_box').hide()
            }else{
                $('.return_box').show()
            }
        })
    </script>
@endsection
